/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#ifndef __GAME_WORLD_H__
#define __GAME_WORLD_H__

#include "Ogre.h"
#include "OIS/OIS.h"

#include "SceneObject.h"
#include "WorldMap.h"

namespace PQGame
{
	//recent character test
	class GameWorld
		: public OIS::MouseListener, public OIS::KeyListener
	{
	public:
		static GameWorld &getSingleton();
		void init(PQEngine::SceneObject* sceneObject);
		void update(float deltaT);

		void initInputListener();

		/*
		*/
		void loadWorld(int index);

		void enterTile(int x,int y);

	protected:
		bool keyPressed( const OIS::KeyEvent &e );
		bool keyReleased( const OIS::KeyEvent &e );

		bool mouseMoved( const OIS::MouseEvent &e );
		bool mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id );
		bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id );
	protected:
		GameWorld(void);
		~GameWorld(void);
	private:
		PQEngine::SceneObject* _sceneObject;
		void initGameData();
		void initCamera();
	private:
		WorldMap* _map;//current world map
	};
}
#define SGameWorld PQGame::GameWorld::getSingleton()

#endif
